package com.pets.Config;

import com.pets.entity.Users;

/**
 * 基于ThreadLocal封装工具类，用户保存和获取当前登录用户信息
 */
public class BaseContext {
    private static ThreadLocal<Users> threadLocal=new ThreadLocal<Users>();

    public static void setCurrentId(Users users){
        threadLocal.set(users);
    }

    public static Users getCurrentId(){
        return threadLocal.get();
    }
}
